package com.heima.xxljob.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class HelloJob {
    @Value("${xxl.job.executor.port}")
    private int port;

    @XxlJob("helloJob")
    public ReturnT hello(String message) {
        System.out.println("hellojob任务被执行了，端口号为：" + port + "当前时间：" + System.currentTimeMillis());
        return ReturnT.SUCCESS;
    }
}
